#region File Description
//-----------------------------------------------------------------------------
// Game.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.GamerServices;
#endregion

namespace GrapplingHookGame
{
    /// <summary>
    /// Sample showing how to manage the different game states involved in
    /// implementing a networked game, with menus for creating, searching,
    /// and joining sessions, a lobby screen, and the game itself. This main
    /// game class is extremely simple: all the interesting stuff happens
    /// in the ScreenManager component.
    /// </summary>
    public class GrapplingHookGameGame : Microsoft.Xna.Framework.Game
    {
        #region Fields

        private GraphicsDeviceManager graphics;
        private ScreenManager screenManager;
        private SoundComponent soundComponent;
        #endregion



        #region Initialization


        /// <summary>
        /// The main game constructor.
        /// </summary>
        public GrapplingHookGameGame()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);

            graphics.PreferredBackBufferWidth = 1280;
            graphics.PreferredBackBufferHeight = 720;

            // Create components.
            soundComponent = new SoundComponent(this, "Content\\Audio\\GrapplingHookGameAudio.xgs");
            soundComponent.AddInMemoryWaveBank("Content\\Audio\\Wave Bank.xwb");
            soundComponent.AddStreamingWaveBank("Content\\Audio\\Music Waves.xwb");
            soundComponent.SetSoundBank("Content\\Audio\\Sound Bank.xsb");

            screenManager = new ScreenManager(this);
            Components.Add(screenManager);
            Components.Add(soundComponent);
            Components.Add(new MessageDisplayComponent(this));
            Components.Add(new GamerServicesComponent(this));

            // Activate the first screens.
            screenManager.AddScreen(new BackgroundScreen());
            screenManager.AddScreen(new MainMenuScreen());

            //Guide.SimulateTrialMode = true;
        }


        #endregion

        #region Draw


        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        protected override void Draw(GameTime gameTime)
        {
            graphics.GraphicsDevice.Clear(Color.Black);

            // The real drawing happens inside the screen manager component.
            base.Draw(gameTime);
        }


        #endregion
    }


    #region Entry Point

    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    static class Program
    {
        static void Main()
        {
            using (GrapplingHookGameGame game = new GrapplingHookGameGame())
            {
                game.Run();
            }
        }
    }

    #endregion
}
